<?php

namespace App\Observers;

use App\Model\Comment;
use App\Notifications\CommentNotify;

class CommentObserver
{
    /**
     * Handle the comment "created" event.
     *
     * @param  \App\Model\Comment  $comment
     * @return void
     */
    //评论之后给用户发送通知
    public function created(Comment $comment)
    {

        $comment->belongsModel->user->notify(new CommentNotify($comment));
    }


}
